package com.shop.item.api;

import com.shop.item.pojo.SpecGroup;
import com.shop.item.pojo.SpecParam;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @author : Created by HGL on 2019/03/21 01:04
 * @version : 1.0
 * Description :
 */
@RequestMapping("spec")
public interface SpecificationApi {
    /**
     * 查询参数集合
     *
     * @param gid 组id
     * @param cid 分类id
     * @param searching 是否搜索
     * @return
     */
    @GetMapping("/params")
    List<SpecParam> queryParamList(
            @RequestParam(value = "gid",required = false) Long gid,
            @RequestParam(value = "cid",required = false) Long cid,
            @RequestParam(value = "searching",required = false) Boolean searching);

    /**
     * 根据分类查询规格组及组内参数
     * @param cid
     * @return
     */
    @GetMapping("/group")
    List<SpecGroup> queryListByCid(@RequestParam("cid") Long cid);
}
